package cn.lingyangwl.agile.plugin.file.preview.service.impl;

import cn.lingyangwl.agile.plugin.file.preview.model.FileAttribute;
import cn.lingyangwl.agile.plugin.file.preview.model.FilePreviewRS;
import cn.lingyangwl.agile.plugin.file.preview.service.FilePreview;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

/**
 * flv文件预览处理实现
 *
 * @author shenguangyang
 * @since 1.0.0
 */
@Service
public class FlvFilePreviewImpl implements FilePreview {

    private final MediaFilePreviewImpl mediaFilePreview;

    public FlvFilePreviewImpl(MediaFilePreviewImpl mediaFilePreview) {
        this.mediaFilePreview = mediaFilePreview;
    }

    @Override
    public FilePreviewRS filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
        mediaFilePreview.filePreviewHandle(url,model,fileAttribute);
        return FilePreviewRS.builder().type(FLV_FILE_PREVIEW_PAGE).build();
    }
}
